<form id="purchase-request-form" role="form" data-toggle="validator" method="POST" action="">

    <div class="form-group">
        <label class="control-label col-xs-12 col-sm-2">选择物料:</label>
        <div class="col-xs-12 col-sm-8">
            <div class="table-responsive">
                <table class="table table-striped">
                    <thead>
                        <tr>
                            <th><input type="checkbox" id="select-all-materials"></th>
                            <th>物料名称</th>
                            <th>物料编码</th>
                            <th>当前库存</th>
                            <th>最小库存</th>
                            <th>建议采购量</th>
                        </tr>
                    </thead>
                    <tbody>
                        {volist name="shortageMaterials" id="material"}
                        <tr>
                            <td>
                                <input type="checkbox" name="material_ids[]" value="{$material.id}" class="material-checkbox">
                            </td>
                            <td>{$material.name}</td>
                            <td>{$material.code}</td>
                            <td class="text-danger"><strong>{$material.stock} {$material.unit}</strong></td>
                            <td>{$material.min_stock} {$material.unit}</td>
                            <td class="text-success">
                                <strong>{$material.min_stock * 2} {$material.unit}</strong>
                            </td>
                        </tr>
                        {/volist}
                    </tbody>
                </table>
            </div>
        </div>
    </div>

    <div class="form-group">
        <label class="control-label col-xs-12 col-sm-2">选择供应商:</label>
        <div class="col-xs-12 col-sm-8">
            <select id="c-supplier_id" class="form-control selectpicker" name="supplier_id" required>
                <option value="">请选择供应商</option>
                {volist name="suppliers" id="supplier"}
                <option value="{$supplier.id}">{$supplier.name}</option>
                {/volist}
            </select>
        </div>
    </div>

    <div class="form-group">
        <label class="control-label col-xs-12 col-sm-2">优先级:</label>
        <div class="col-xs-12 col-sm-8">
            <select id="c-priority" class="form-control" name="priority">
                <option value="1">低</option>
                <option value="2" selected>中</option>
                <option value="3">高</option>
                <option value="4">紧急</option>
            </select>
        </div>
    </div>

    <div class="form-group">
        <label class="control-label col-xs-12 col-sm-2">备注说明:</label>
        <div class="col-xs-12 col-sm-8">
            <textarea id="c-notes" class="form-control" rows="3" name="notes" placeholder="请输入采购备注说明"></textarea>
        </div>
    </div>

    <div class="form-group layer-footer">
        <label class="control-label col-xs-12 col-sm-2"></label>
        <div class="col-xs-12 col-sm-8">
            <button type="submit" class="btn btn-success btn-embossed disabled">生成采购申请</button>
            <button type="reset" class="btn btn-default btn-embossed">重置</button>
        </div>
    </div>

</form>

